<?php

//--------------------------------------------------------------------------
// Example php script for fetching data from mysql database
// by Trystan Lea : openenergymonitor.org : GNU GPL
//--------------------------------------------------------------------------
$host = "localhost";
$user = "root";
$pass = "";
$data = "";

$databaseName = "solution_center";
$tableName = "latest_courses_updates";

//--------------------------------------------------------------------------
// 1) Connect to mysql database
//--------------------------------------------------------------------------
$con = mysql_connect($host,$user,$pass);
$dbs = mysql_select_db($databaseName, $con);

//--------------------------------------------------------------------------
// 2) Query database for data
//--------------------------------------------------------------------------
$result = mysql_query("SELECT * FROM $tableName");            //query
$data= $data."<div class=center_home><table border=1 bordercolor=red>";
$data = $data." <tr><th>Course Name</th><th>Timings</th><th>Starting Date</th><th>Weekend Batch</th></tr>";
while($row = mysql_fetch_array($result))
{
	$data =  $data."<tr><td>".$row[0] ."</td><td>".$row[1]."</td><td>".$row[2]."</td><td>".$row[3]."</tr>";
}
$data= $data."</table></div>";
echo $data;
?>
